/**
 * There are <a href="https://github.com/thinkgem/jeesite">JeeSite</a> code generation
 */
package com.boxin.ims.modules.wechat.dao;

import org.apache.ibatis.annotations.Update;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.CrudRepository;
import org.springframework.stereotype.Component;

import com.thinkgem.jeesite.common.persistence.BaseDao;
import com.thinkgem.jeesite.common.persistence.BaseDaoImpl;
import com.boxin.ims.modules.wechat.entity.Questionnaire;

/**
 * 调查问卷DAO接口
 * @author XiaoQian
 * @version 2014-05-09
 */
public interface QuestionnaireDao extends QuestionnaireDaoCustom, CrudRepository<Questionnaire, Long> {

	@Modifying
	@Query("delete from  Questionnaire   where id = ?1")
	public int deleteById(Long id);
	
	@Modifying
	@Query("update Questionnaire set startup='1' where user.id=?1")
	public int updateByUserId(Long userId);
	
}

/**
 * DAO自定义接口
 * @author XiaoQian
 */
interface QuestionnaireDaoCustom extends BaseDao<Questionnaire> {

}

/**
 * DAO自定义接口实现
 * @author XiaoQian
 */
@Component
class QuestionnaireDaoImpl extends BaseDaoImpl<Questionnaire> implements QuestionnaireDaoCustom {

}
